<form id="form-wb" method="post" class="luck-from">
    <input type="hidden" id="hid_id" name="hid_id" value="${result.ryId!''}">
    <div class="divider">
        <span><i class="fa fa-plus fa-lg"></i>&nbsp;&nbsp;基本信息</span>
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">员工姓名：</span>
        <input class="easyui-textbox" id="ry_xm" name="ry_xm" data-options="required:'true',missingMessage:'员工姓名不能为空！',validType:['maxLen[100,\'1~100位字符，英文一个字符，中文两个字符!\']','checkRyxm[\'${ctxPath}/htxx/checkRyxm\',\'${i18n('msg.htxx.found')}\']'],validateOnCreate:false" style="width:200px"
               value="${result.ryXm!''}">
        <span class="luck-block" style="width:100px">公司：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="required:'true',prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/gs', method:'post', valueField:'gsId', textField:'gsMc',validType:'selectValueRequired[\'sel_gs\',\'公司不能为空！\']',editable:true,width:200,onChange:gsChange,validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.gsId}');$(this).combobox('validate');}"
                id="sel_gs" name="sel_gs"></select>
        <span class="luck-block" style="width:100px">小公司：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="required:'true',prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/xgs?gsid=${result.gsId}', method:'get',valueField:'gsbId',textField:'gsbMc',validType:'selectValueRequired[\'sel_xgs\',\'小公司不能为空！\']',editable:true,width:200,validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.gsId}'!=$('#sel_gs').combobox('getValue')?'':'${result.gsbId}');$(this).combobox('validate');}"
                id="sel_xgs" name="sel_xgs"></select>
    </div>
    <div class="group-label">
    		<span class="luck-block" style="width:100px"><span class="star">*</span>证件类型：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="required:'true',prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/zjlx', method:'post', valueField:'DM', textField:'MC',validType:'selectValueRequired[\'sel_zjlx\',\'证件类型不能为空！\']',editable:true,width:200,validateOnCreate:false,value:${isEmpty(result.ryZjlx)?'201':result.ryZjlx}" id="sel_zjlx"
                name="sel_zjlx"></select>
        <span class="luck-block" style="width:100px">证件号码：</span>
        <input class="easyui-textbox" id="ry_zjhm" name="ry_zjhm" data-options="required:'true',missingMessage:'证件号码不能为空！',validType:'sfz[\'sel_zjlx\',\'请输入15或18位正确的身份证号码!\']',validateOnCreate:false" style="width:200px" value="${result.ryZjhm!''}">
        <span class="luck-block" style="width:100px">联系方式：</span>
        <input class="easyui-textbox" id="ry_lxfs" name="ry_lxfs" data-options="validType:'maxLen[100,\'1~100位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryLxfs!''}">
    </div>
    <div class="group-label">
    		<span class="luck-block" style="width:100px">客户编号：</span>
        <input class="easyui-textbox" id="ry_khbh" name="ry_khbh" data-options="validType:'maxLen[50,\'1~50位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryKhbh!''}">
        <span class="luck-block" style="width:100px">派遣代理：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/pqdlfs', method:'post', valueField:'DM', textField:'MC',editable:false,width:200,validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.ryPqdl}');$(this).combobox('validate');}"
                id="sel_pqdlfs" name="sel_pqdlfs"></select>
        <span class="luck-block" style="width:100px">本人身份：</span>
        <input class="easyui-textbox" id="ry_brsf" name="ry_brsf" data-options="validType:'maxLen[100,\'1~100位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryBrsf!''}">
    </div>
    <div class="group-label">
    		<span class="luck-block" style="width:100px">电脑号：</span>
        <input class="easyui-textbox" id="ry_dnh" name="ry_dnh" data-options="validType:'maxLen[50,\'1~50位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryDnh!''}">
        <span class="luck-block" style="width:100px"><span class="star">*</span>负责人：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="required:'true',prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/user', method:'post', valueField:'USER_ID', textField:'USER_XM',editable:true,width:200,validType:'selectValueRequired[\'sel_dlr\',\'负责人不能为空！\']',validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.dlr}');$(this).combobox('validate');}"
                id="sel_dlr"
                name="sel_dlr"></select>
        <span class="luck-block" style="width:100px">起始日：</span>
        <input class="easyui-my97" id="ry_qsr" name="ry_qsr" data-options="required:'true',missingMessage:'起始日不能为空！',dateFmt:'yyyy-MM-dd',validateOnCreate:false" style="width:160px" value="${result.ryQsr!'','yyyy-MM-dd'}">
    </div>
    <div class="group-label">
    		<span class="luck-block" style="width:100px">下单时间：</span>
        <input class="easyui-my97" id="ry_xdsj" name="ry_xdsj" data-options="required:'true',missingMessage:'下单时间不能为空！',dateFmt:'yyyy-MM-dd'" style="width:160px" value="${isEmpty(result.ryXdsj)?'':strutil.formatDate(result.ryXdsj,'yyyy-MM-dd')}">
        <span class="luck-block" style="width:100px"><span class="star">*</span>增员成功日期：</span>
        <input class="easyui-my97" id="ry_zycgrq" name="ry_zycgrq" data-options="required:'true',missingMessage:'增员成功日期不能为空！',dateFmt:'yyyy-MM-dd'" style="width:160px" value="">
        <span class="luck-block" style="width:100px">下增减时间：</span>
        <input class="easyui-my97" id="ry_xzjsj" name="ry_xzjsj" data-options="dateFmt:'yyyy-MM-dd'" style="width:160px" value="${isEmpty(result.ryXzjsj)?'':strutil.formatDate(result.ryXzjsj,'yyyy-MM-dd')}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">备注：</span>
        <input class="easyui-textbox" id="ry_bz" name="ry_bz" data-options="multiline:true,validType:'maxLen[400,\'1~400位字符，英文一个字符，中文两个字符!\']'" style="width:600px;height:50px" value="${result.bz!''}">
    </div>
    <div class="divider">
        <span><i class="fa fa-plus fa-lg"></i>&nbsp;&nbsp;社保信息</span>
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">社保缴纳地：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="required:'true',prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/sbjnd', method:'post', valueField:'DM', textField:'MC',editable:false,width:200,validType:'selectValueRequired[\'sel_sbjnd\',\'社保缴纳地不能为空！\']',validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.sbjndDm}');$(this).combobox('validate');}"
                id="sel_sbjnd" name="sel_sbjnd"></select>
        <span class="luck-block" style="width:100px">公积金缴纳地：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="required:'true',prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/gjjjnd', method:'post', valueField:'DM', textField:'MC',editable:false,width:200,validType:'selectValueRequired[\'sel_gjjjnd\',\'公积金缴纳地不能为空！\']',validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.gjjjndDm}');$(this).combobox('validate');}"
                id="sel_gjjjnd" name="sel_gjjjnd"></select>
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">员工社保号：</span>
        <input class="easyui-textbox" id="ry_sbh" name="ry_sbh" data-options="validType:'maxLen[30,\'1~30位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.rySbh!''}">
        <span class="luck-block" style="width:100px">员工公积金号：</span>
        <input class="easyui-textbox" id="ry_gjjh" name="ry_gjjh" data-options="validType:'maxLen[30,\'1~30位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryGjjh!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">社保账户：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/sbzh', method:'post', valueField:'DM', textField:'MC',editable:false,width:200,onChange:sbChange,validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.sbjnzhDm}');$(this).combobox('validate');}"
                id="sel_sbzh" name="sel_sbzh"></select>
        <span class="luck-block" style="width:100px">社保账号：</span>
        <input class="easyui-textbox" id="ry_sbzhbh" name="ry_sbzhbh" data-options="readonly:true" style="width:200px">
        <span class="luck-block" style="width:100px">谁付款给社保局：</span>
        <input class="easyui-textbox" id="ry_sfkgsb" name="ry_sfkgsb" data-options="validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.rySfkgsb!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">公积金账户：</span>
        <select class="easyui-combobox" panelHeight="auto"
                data-options="prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/gjjzh', method:'post', valueField:'DM', textField:'MC',editable:false,width:200,onChange:gjjChange,validateOnCreate:false,onLoadSuccess:function(data){ $(this).combobox('setValue','${result.gjjzhDm}');$(this).combobox('validate');}"
                id="sel_gjjzh" name="sel_gjjzh"></select>
        <span class="luck-block" style="width:100px">公积金账号：</span>
        <input class="easyui-textbox" id="ry_gjjzhbh" name="ry_gjjzhbh" data-options="readonly:true" style="width:200px">
        <span class="luck-block" style="width:100px">谁付款给公积金：</span>
        <input class="easyui-textbox" id="ry_sfkggjj" name="ry_sfkggjj" data-options="validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.rySfkggjj!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px;text-align: center">社保费谁付款给我们：</span>
        <input class="easyui-textbox" id="ry_sbfsfkgw" name="ry_sbfsfkgw" data-options="validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.rySbfsfgw!''}">
        <span class="luck-block" style="width:100px;text-align: center">公积金费谁付款给我们：</span>
        <input class="easyui-textbox" id="ry_gjjsfkgw" name="ry_gjjsfkgw" data-options="validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryGjjsfgw!''}">
        <span class="luck-block" style="width:100px">服务费青分/青岛：</span>
        <input class="easyui-textbox" id="ry_fwfjn" name="ry_fwfjn" data-options="validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.ryFwfjn!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">年度社保基数：</span>
        <input class="easyui-numberbox" id="gz_ndsb" name="gz_ndsb" data-options="min:0,precision:2" style="width:200px" value="${result.gzNdsb!''}">
        <span class="luck-block" style="width:100px">年度公积金基数：</span>
        <input class="easyui-numberbox" id="gz_ndgjj" name="gz_ndgjj" data-options="min:0,precision:2,onChange:sbjnhj" style="width:200px" value="${result.gzNdgjj!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">公司比例：</span>
        <input class="easyui-numberbox" id="gz_gsbl" name="gz_gsbl" data-options="min:0,max:1,precision:2,onChange:sbjnhj" style="width:200px" value="${result.gzGsbl!''}">
        <span class="luck-block" style="width:100px">个人比例：</span>
        <input class="easyui-numberbox" id="gz_grbl" name="gz_grbl" data-options="min:0,max:1,precision:2,onChange:sbjnhj" style="width:200px" value="${result.gzGrbl!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">公司金额：</span>
        <input class="easyui-numberbox" id="gz_gsjn" name="gz_gsjn" data-options="min:0,precision:2,readonly:true" style="width:120px" value="${result.gzGsjn!''}">
        <input class="easyui-numberbox" id="gz_gsjn1" name="gz_gsjn1" data-options="min:0,precision:0,readonly:true" style="width:80px" value="${result.gzGsjn1!''}">
        <span class="luck-block" style="width:100px">个人金额：</span>
        <input class="easyui-numberbox" id="gz_grjn" name="gz_grjn" data-options="min:0,precision:2,readonly:true" style="width:120px" value="${result.gzGrjn!''}">
        <input class="easyui-numberbox" id="gz_grjn1" name="gz_grjn1" data-options="min:0,precision:0,readonly:true" style="width:80px" value="${result.gzGrjn1!''}">
        <span class="luck-block" style="width:100px">缴纳合计：</span>
        <input class="easyui-numberbox" id="gz_sbjnhj" name="gz_sbjnhj" data-options="min:0,precision:2,readonly:true" style="width:120px" value="${result.gzSbjnhj!''}">
    		<input class="easyui-numberbox" id="gz_sbjnhj1" name="gz_sbjnhj1" data-options="min:0,precision:0,readonly:true" style="width:80px" value="${result.gzSbjnhj1!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">社保备注：</span>
        <input class="easyui-textbox" id="gz_sbbz" name="gz_sbbz" data-options="multiline:true,validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:300px;height:50px" value="${result.sbbz!''}">
        <span class="luck-block" style="width:100px">公积金备注：</span>
        <input class="easyui-textbox" id="gz_gjjbz" name="gz_gjjbz" data-options="multiline:true,validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:300px;height:50px" value="${result.gjjbz!''}">
    </div>
    <div class="divider">
        <span><i class="fa fa-plus fa-lg"></i>&nbsp;&nbsp;工资福利信息</span>
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">服务费：</span>
        <input class="easyui-numberbox" id="gz_fwf" name="gz_fwf" data-options="min:0,precision:2" style="width:200px" value="${result.gzFwf!''}">
        <span class="luck-block" style="width:100px">档案费：</span>
        <input class="easyui-numberbox" id="gz_daf" name="gz_daf" data-options="min:0,precision:2" style="width:200px" value="${result.gzDaf!''}">
        <span class="luck-block" style="width:100px">人身保障：</span>
        <input class="easyui-numberbox" id="gz_rsbz" name="gz_rsbz" data-options="min:0,precision:2" style="width:200px" value="${result.gzRsbz!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">门诊医疗：</span>
        <input class="easyui-numberbox" id="gz_mzyl" name="gz_mzyl" data-options="min:0,precision:2" style="width:200px" value="${result.gzMzyl!''}">
        <span class="luck-block" style="width:100px">体检：</span>
        <input class="easyui-numberbox" id="gz_tj" name="gz_tj" data-options="min:0,precision:2" style="width:200px" value="${result.gzTj!''}">
        <span class="luck-block" style="width:100px">重大疾病：</span>
        <input class="easyui-numberbox" id="gz_zdjb" name="gz_zdjb" data-options="min:0,precision:2" style="width:200px" value="${result.gzZdjb!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">住院补贴：</span>
        <input class="easyui-numberbox" id="gz_zybt" name="gz_zybt" data-options="min:0,precision:2" style="width:200px" value="${result.gzZybt!''}">
        <span class="luck-block" style="width:100px">子女门诊：</span>
        <input class="easyui-numberbox" id="gz_znmz" name="gz_znmz" data-options="min:0,precision:2" style="width:200px" value="${result.gzZnmz!''}">
        <span class="luck-block" style="width:100px">子女意外：</span>
        <input class="easyui-numberbox" id="gz_znyw" name="gz_znyw" data-options="min:0,precision:2" style="width:200px" value="${result.gzZnyw!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">家财：</span>
        <input class="easyui-numberbox" id="gz_jc" name="gz_jc" data-options="min:0,precision:2" style="width:200px" value="${result.gzJc!''}">
        <span class="luck-block" style="width:100px">联谊慰问(生日)：</span>
        <input class="easyui-numberbox" id="gz_sr" name="gz_sr" data-options="min:0,precision:2" style="width:200px" value="${result.gzSr!''}">
        <span class="luck-block" style="width:100px">联谊慰问(活动)：</span>
        <input class="easyui-numberbox" id="gz_hd" name="gz_hd" data-options="min:0,precision:2" style="width:200px" value="${result.gzHd!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">取暖费：</span>
        <input class="easyui-numberbox" id="gz_qnf" name="gz_qnf" data-options="min:0,precision:2" style="width:200px" value="${result.gzQnf!''}">
        <span class="luck-block" style="width:100px">薪酬及税金：</span>
        <input class="easyui-numberbox" id="gz_xcsj" name="gz_xcsj" data-options="min:0,precision:2" style="width:200px" value="${result.gzXcsj!''}">
        <span class="luck-block" style="width:100px">税金：</span>
        <input class="easyui-numberbox" id="gz_sj" name="gz_sj" data-options="min:0,precision:2" style="width:200px" value="${result.gzSj!''}">
    </div>
    <div class="group-label">
        <span class="luck-block" style="width:100px">其他一：</span>
        <input class="easyui-numberbox" id="gz_qt1" name="gz_qt1" data-options="min:0,precision:2" style="width:200px" value="${result.gzQt1!''}">

        <span class="luck-block" style="width:100px">其他一备注：</span>
        <input class="easyui-textbox" id="gz_qt1bz" name="gz_qt1bz" data-options="validType:'maxLen[200,\'1~200位字符，英文一个字符，中文两个字符!\']'" style="width:200px" value="${result.gzQt1bz!''}">
    </div>
</form>
<script>
    function gsChange(value) {
        //alert(value);
        if (value != "")//不为空
        {
            //小公司获取列表
            $("#sel_xgs").combobox("clear");
            $("#sel_xgs").combobox("reload", "${ctxPath}/dm/xgs?gsid=" + value);
            //$("#sel_ry").combobox("clear");
            //员工姓名重置
        }
        else {
            $("#sel_xgs").combobox("clear");
            //$("#sel_ry").combobox("clear");
        }
    }

    function sbChange(value) {
        //alert(value);
        if (value != "")//不为空
        {
            var data = $("#sel_sbzh").combobox("getData");
            for (var i = 0; i < data.length; i++) {
                if (data[i].DM == value) {
                    $("#ry_sbzhbh").textbox("setValue", data[i].BH);
                    break;
                }
            }
        }
        else {
            $("#ry_sbzhbh").textbox("setValue", "");
        }
    }

    function gjjChange(value) {
        //alert(value);
        if (value != "")//不为空
        {
            var data = $("#sel_gjjzh").combobox("getData");
            for (var i = 0; i < data.length; i++) {
                if (data[i].DM == value) {
                    $("#ry_gjjzhbh").textbox("setValue", data[i].BH);
                    break;
                }
            }
        }
        else {
            $("#ry_gjjzhbh").textbox("setValue", "");
        }
    }

    function sbjnhj() {
        //console.log("ndgjjjs:"+$("#gz_ndgjj").numberbox("getValue")+"grbl:"+$("#gz_grbl").numberbox("getValue")+"gsbl:"+$("#gz_gsbl").numberbox("getValue"));
        var ndgjjjs = toNum($("#gz_ndgjj").numberbox("getValue"));//年度公积金基数
        var grbl = toNum($("#gz_grbl").numberbox("getValue"));//个人比例
        var gsbl = toNum($("#gz_gsbl").numberbox("getValue"));//公司比例
        //console.log("ndgjjjs:"+ndgjjjs+"grbl:"+grbl+"gsbl:"+gsbl);
        $("#gz_grjn").numberbox("setValue", Decimal.mul(ndgjjjs, grbl));//个人缴纳
        $("#gz_gsjn").numberbox("setValue", Decimal.mul(ndgjjjs, gsbl));//公司缴纳
        $("#gz_sbjnhj").numberbox("setValue", Decimal.add(toNum($("#gz_grjn").numberbox("getValue")), toNum($("#gz_gsjn").numberbox("getValue"))));//缴纳合计
        $("#gz_grjn1").numberbox("setValue", Decimal.floor(Decimal.mul(ndgjjjs, grbl)));//个人缴纳整数
        $("#gz_gsjn1").numberbox("setValue", Decimal.floor(Decimal.mul(ndgjjjs, gsbl)));//公司缴纳整数
        $("#gz_sbjnhj1").numberbox("setValue", Decimal.floor(toNum($("#gz_sbjnhj").numberbox("getValue"))));//缴纳合计整数
    }

</script>